package com.mashuai.utils.ztest.pb.bean;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mashuai.utils.toolkit.core.msHandlebean.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @ClassName: MsRoom
 * @Description: 房间
 */
@Data
@TableName("ms_room")
public class MsRoom implements Serializable {
    //实体加上@MsDelCheck注解，"ms_user@room_id@name",含义是检测准备删除的房间id值，是否被ms_user表的room_id进行引用，如果引用了，提示ms_user表的name字段值
//    @MsDelCheck(checkTable = {"ms_user@room_id"},condition = "ms_user.type = 0 ")
//    //主子表数据带出
//    @MsJoinSubTable(joinTable = "ms_user", joinField = "room_id", clazz = MsUser.class, setField = "userList", condition = " type = 1 ")
    @TableId("id")
    private String id;
//    @TableField(exist = false)
//    private String billCode;

//    //租户子表信息
//    @TableField(exist = false)
//    private List<MsUser> userList;

    @TableLogic
    private String deflag;

//    @TableField(value = "create_time")
//    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
//    private Date createTime;
//
//    //楼栋id，冗余字段
    @MsJoinTable(joinTable = "ms_building", needFields = {"name@buildName", "remark@buildRemark"})
    @TableField(value = "building_id")
    private String buildingId;
    @TableField(exist = false)
    private String buildName;
    @TableField(exist = false)
    private String buildRemark;

   // 楼层ID
    @MsJoinTable(joinTable = "ms_floor", needFields = "name@floorName111")
    @TableField(value = "floor_id")
    private String floorId111;
    @TableField(exist = false)
    private String floorName111;
    //楼层id2
    @MsJoinTable(joinTable = "ms_floor", needFields = "name@floorName222")
    @TableField(value = "floor_id2")
    private String floorId222;
    @TableField(exist = false)
    private String floorName222;
    //户型ID
    @MsJoinTable(joinTable = "ms_layout", needFields = {"name@layoutName","reamrk@layoutRemark"})
    @TableField(value = "layout_id")
    private String layoutId;
    @TableField(exist = false)
    private String layoutName;
    @TableField(exist = false)
    private String layoutRemark;

    //房间类型，0-商务，1-VIP房，2-民宿，字典类型：roomType
    @MsJoinDict(dictType = "roomType", setField = "roomTypeName",splitVal = "@@@@")
    private String type;
    @TableField(exist = false)
    private String roomTypeName;
    @MsJoinDict(dictType = "roomType", setField = "roomTypeName2")
    private String type2;
    @TableField(exist = false)
    private String roomTypeName2;

//
//
//    //房间是可正常使用状态，0-可用，1-损坏，字典类型roomState
//    @MsJoinDict(dictType = "roomState")
//    private String state;
//
//    //房间面积
//    private Double area;
//
//    //房间名称
//    @MsSaveCheck
//    private String name;
//
//    //房间描述
//    private String remark;

}